package com.yun.studyconsumer.conf;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DirectRabbitConfig {

    @Bean
    public Queue studyDirectQueue(){
        return new Queue("StudyDirectQueue",true);
    }

    @Bean
    public DirectExchange studyDirectExchange(){
        return new DirectExchange("StudyDirectExchange",true,false);
    }

    @Bean
    public Binding bindingDirect(){
        return BindingBuilder.bind(studyDirectQueue()).to(studyDirectExchange()).with("StudyDirectRouting");
    }
}
